package com.villaday.idf.adapter3;

import android.content.Context;
import android.view.View;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.model3.AddressTypeEntity;
import com.villaday.idf.model3.DataEntity;

public class ChooseCityAdapter extends AbsRecyclerViewAdapter<AddressTypeEntity.BodyBean.CitiesBean> {


    public ChooseCityAdapter(Context context) {
        super(context, R.layout.recycle_choose_city);
    }

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, AddressTypeEntity.BodyBean.CitiesBean d, int position) {
        holder.bindTextView(R.id.tv_cc_title, d.getName());
        if (d.getProvinces() != null && d.getProvinces().getCountrys() != null && d.getProvinces().getCountrys().getName() != null && d.getProvinces().getName() != null) {
            holder.getView(R.id.tv_cc_content).setVisibility(View.VISIBLE);
            holder.bindTextView(R.id.tv_cc_content, d.getProvinces().getCountrys().getName() + "·" + d.getProvinces().getName());
        }else {
            holder.getView(R.id.tv_cc_content).setVisibility(View.INVISIBLE);
        }
    }
}
